package com.ydj.framework.module.city.entity;

import com.ydj.framework.mysql.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.*;

@Getter
@Setter
@Entity
@Accessors(chain = true)
@Table(name = "dict_city",
        indexes = {@Index(columnList = "level"), @Index(columnList = "parentId")}
)
@org.hibernate.annotations.Table(appliesTo = "dict_city", comment = "字典-城市列表")
public class DictCity extends BaseEntity {

    @Column(columnDefinition = "varchar(30) comment '名称'", nullable = false)
    private String name;

    @Column(columnDefinition = "tinyint comment '级别'", nullable = false)
    private Integer level;

    @Column(columnDefinition = "bigint comment '父级城市'", nullable = false)
    private Long parentId;
}